-
Notifications
You must be signed in to change notification settings - Fork 273
introduce binding_exprt [blocks: #4510] #4931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4931 +/- ##
===========================================
+ Coverage 69.24% 69.25% +<.01%
===========================================
Files 1309 1309
Lines 108476 108499 +23
===========================================
+ Hits 75117 75141 +24
+ Misses 33359 33358 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: ce8b26c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/119891946
335fb5c
to
f13b9d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't the users (e.g. typecheck_expr_main
) use the newly-introduced interface instead of the pretty-opaque expr.op0().op0().op0()
?
@@ -145,14 +140,14 @@ instantiate_quantifier(const quantifier_exprt &expr, const namespacet &ns) | |||
return re; | |||
} | |||
|
|||
const exprt min_i = get_quantifier_var_min(var_expr, re); | |||
const exprt max_i = get_quantifier_var_max(var_expr, re); | |||
const auto min_i = get_quantifier_var_min(var_expr, re); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use constant_exprt
, nothing else here makes it obvious we're talking about a constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These .op0()
chains are very opaque and make it rather impossible to understand what's going on. And then wouldn't we really also need to make some changes in the back-end now that the structure of those expressions is different? And the commit message talks about lambdas, lets, but only quantifiers received this new treatment. I don't think we should do half-a-job here.
f4a41ab
to
1895684
Compare
225d1cf
to
4386617
Compare
I've introduce further typing to reduce the |
Well, we have |
I'll clean up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 190f1c8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/121976290
|
||
variablest &variables() | ||
{ | ||
return (variablest &)static_cast<tuple_exprt &>(op0()).operands(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite likely this isn't the only such place, but this clearly makes USE_LIST
no longer possible -- but in this case without causing compilation errors. So should we really get rid of USE_LIST
right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be possible to make this work with USE_LIST
. Is USE_LIST
sill useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code wouldn't actually compile with USE_LIST
. If USE_LIST
were to work, we could change irept
to have only a single container and some cursor(s) into that. Whether that's more efficient or not I can't tell, because it wouldn't compile...
This is a base class that factors out some common functionality of various expressions that are variable bindings; examples are let, lambda, forall, exists; future additions might include choose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 3243b98).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122132439
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
This commit makes the quantifier base class use the bindings base class. Methods and constructor for the special case of quantifying over one variable are retained.
This clarifies that the expression returned by get_quantifier_var_min is a constant -- request by @smowton.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 0983a0c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122168140
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 0983a0c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122168140
This is a base class that factors out some common functionality of various
expressions that are variable bindings; examples are let, lambda, forall,
exists; future additions might include choose.